package com.sbj.dto.res;

import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.SearchBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sbj.dto.jackson.CustomDecimalSerialize;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author summer
 * @version 1.0
 * @date 2024/8/29 11:06
 */
@Data
@SearchBean(tables = "  income i")
public class ExtensionAmountRes implements Serializable {

    @DbField("(CASE WHEN  sum(i.price) IS NULL THEN 0 ELSE  sum(i.price) END)")
    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal total;

    @DbField("i.member_id")
    private Integer memberId;

    @DbField("i.createTime")
    private LocalDateTime createTime;

    @DbField("i.type")
    private Integer type;

}
